package com.winning.controller;

import com.winning.entity.MyDTO;
import com.winning.service.ProduceDeductService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rabbit")
@Slf4j
public class RabbitController {
    @Autowired
    private ProduceDeductService produceService;

    /**
     * 从前端接收dto
     * @param myDTO
     */
    @PostMapping("/test_mydto")
    public void testMyDTO(@RequestBody MyDTO myDTO){
        log.info(myDTO.toString());
    }

    @GetMapping("/sendDeduct")
    public String sendDeduct(){
        produceService.perfectSendDirect();
        return "success";
    }


}
